import { CacheTaskLogMap, TaskLogMap } from "@model/TaskLogMap";
import { defineStore } from "pinia";

const UseCacheTaskLog = defineStore("taskLogMap", {
  state() {
    const cacheTaskLogMap = new CacheTaskLogMap([], new Map<string, TaskLogMap>(), []);
    return {
      cacheTaskLogMap: cacheTaskLogMap,
    };
  },
  actions: {
    setCacheTaskLogMap: function (taskLogMap: CacheTaskLogMap) {
      // console.log("surfaceSetting", surfaceSetting);
      // console.log('surfaceSetting',...surfaceSetting)
      this.getCacheTaskLogMap().setInfo(taskLogMap);
      // this.surfaceSetting.setInfo(...surfaceSetting);
      // this.setting = setting;
    },
    getCacheTaskLogMap: function (): CacheTaskLogMap {
      return this.cacheTaskLogMap;
    },
    // getTaskLogMap:function(timeStamp:number):CacheTaskLogMap{
    //
    //
    // },
    setCacheTaskLogList: function (cacheTaskLogList: Array<string>) {
      this.cacheTaskLogMap.cacheTaskLogList = cacheTaskLogList;
    },
    // save2:function(){
    //
    // },
  },
  getters: {},
});
export default UseCacheTaskLog;
